04. Spring Boot Exception Handling - Summary

035ND C01 L04 A08 EXCEPTION SUMMARY

Let’s recap these spring boot exception handling.

  1. Create custom error page. -> create a error.html page, when errors happen, customer will be redirected to this page.

  2. @ExceptionHandler. -> handle exceptions inside each controller.

  3. @ControllerAdvice + @ExceptionHandler
    Create a separate class and write all exceptions based on their types.

  4. Configure SimpleMappingExceptionResolver class ->
    Rather than adding one method per exception, create a key-value pair class, and let system look for the error.

  5. Custom HandlerExceptionResolver class -> use reflection to find what type of exception it’s